package com.cherrish.demo.reflect;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * @author cherrish
 * @time 2019-03-19 16:18
 * @name TestInvoke
 * @desc:
 */
public class TestInvoke {
    public static void main(String[] args) {
        Count count = new MathCount();
        InvocationHandler handler = new DynamicProxy(count);

        Count count1 = (Count) Proxy.newProxyInstance(handler.getClass().getClassLoader(), count.getClass().getInterfaces(), handler);
        count1.add(1, 2);
        count1.div(2, 1);
    }
}
